package com.nuodui.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuodui.common.Result;
import com.nuodui.domain.vo.GetAnalysisDataByTopicIdVO;
import com.nuodui.service.IAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "统计分析模块")
@RestController
@RequestMapping("/analysis")
@RequiredArgsConstructor
public class AnalysisController {

    private final IAnalysisService analysisService;

    @ApiOperation("根据问题获取统计信息")
    @GetMapping("/getAnalysisDataByTopicId")
    public Result<GetAnalysisDataByTopicIdVO> getAnalysisDataByTopicId(@RequestParam String topicId){

        GetAnalysisDataByTopicIdVO vo = analysisService.getAnalysisDataByTopicId(topicId);

        return Result.success(vo);
    }
}
